home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / xmu / xct.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  5.6 KB  |  133 lines

  1. #ifndef _Xct_h
  2. #define _Xct_h
  3.  
  4. /* 
  5.  * $XConsortium: Xct.h,v 1.3 89/11/21 12:03:47 rws Exp $
  6.  * Copyright 1989 by the Massachusetts Institute of Technology
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted, provided 
  10.  * that the above copyright notice appear in all copies and that both that 
  11.  * copyright notice and this permission notice appear in supporting 
  12.  * documentation, and that the name of M.I.T. not be used in advertising
  13.  * or publicity pertaining to distribution of the software without specific, 
  14.  * written prior permission. M.I.T. makes no representations about the 
  15.  * suitability of this software for any purpose.  It is provided "as is"
  16.  * without express or implied warranty.
  17.  *
  18.  */
  19.  
  20. #define XctVersion 1
  21.  
  22. typedef unsigned char *XctString;
  23.  
  24. typedef enum _XctHDirection { /* Tagged. POHC 90/10/12 */
  25.     XctUnspecified,
  26.     XctLeftToRight,
  27.     XctRightToLeft
  28. } XctHDirection;
  29.  
  30. typedef unsigned long XctFlags;
  31.  
  32. /* These are bits in XctFlags. */
  33.  
  34. #define XctSingleSetSegments    0x0001
  35.    /* This means that returned segments should contain characters from only
  36.     * one set (C0, C1, GL, GR).  When this is requested, XctSegment is never
  37.     * returned, instead XctC0Segment, XctC1Segment, XctGlSegment, and
  38.     * XctGRSegment are returned.  C0 and C1 segments are always returned as
  39.     * singleton characters.
  40.     */
  41.  
  42. #define XctProvideExtensions    0x0002
  43.    /* This means that if the Compound Text string is from a higher version
  44.     * than this code is implemented to, then syntactically correct but unknown
  45.     * control sequences should be returned as XctExtension items.  If this
  46.     * flag is not set, and the Compound Text string version indicates that
  47.     * extensions cannot be ignored, then each unknown control sequence will be
  48.     * reported as an XctError.
  49.     */
  50.  
  51. #define XctAcceptC0Extensions    0x0004
  52.    /* This means that if the Compound Text string is from a higher version
  53.     * than this code is implemented to, then unknown C0 characters should be
  54.     * treated as if they were legal, and returned as C0 characters (regardless
  55.     * of how XctProvideExtensions is set).  If this flag is not set, then all
  56.     * unknown C0 characters are treated according to XctProvideExtensions.
  57.     */
  58.  
  59. #define XctAcceptC1Extensions    0x0008
  60.    /* This means that if the Compound Text string is from a higher version
  61.     * than this code is implemented to, then unknown C0 characters should be
  62.     * treated as if they were legal, and returned as C0 characters (regardless
  63.     * of how XctProvideExtensions is set).  If this flag is not set, then all
  64.     * unknown C0 characters are treated according to XctProvideExtensions.
  65.     */
  66.  
  67. #define XctHideDirection    0x0010
  68.    /* This means that horizontal direction changes should be reported as
  69.     * XctHorizontal items.  If this flag is not set, then direction changes are
  70.     * not returned as items, but the current direction is still maintained and
  71.     * reported for other items.
  72.     */
  73.  
  74. #define XctFreeString        0x0020
  75.    /* This means that XctFree should free the Compound Text string (that was
  76.     * passed to XctCreate.  If this flag is not set, the string is not freed.
  77.     */
  78.  
  79. #define XctShiftMultiGRToGL    0x0040
  80.    /* Translate GR segments on-the-fly into GL segments for the GR sets:
  81.     * GB2312.1980-1, JISX0208.1983-1, and KSC5601.1987-1.
  82.     */
  83.  
  84. /* This is the return type for XctNextItem. */
  85. typedef enum _XctResult { /* Tagged. POHC 90/10/12 */
  86.     XctSegment,        /* used when XctSingleSetSegments is not requested */
  87.     XctC0Segment,    /* used when XctSingleSetSegments is requested */
  88.     XctGLSegment,    /* used when XctSingleSetSegments is requested */
  89.     XctC1Segment,    /* used when XctSingleSetSegments is requested */
  90.     XctGRSegment,    /* used when XctSingleSetSegments is requested */
  91.     XctExtendedSegment,    /* an extended segment */
  92.     XctExtension,    /* used when XctProvideExtensions is requested */
  93.     XctHorizontal,    /* horizontal direction or depth change */
  94.     XctEndOfText,    /* end of text string */
  95.     XctError        /* syntactic or semantic error */
  96. } XctResult;
  97.  
  98. typedef struct _XctRec {
  99.     XctString        total_string;    /* as given to XctCreate */
  100.     int            total_length;    /* as given to XctCreate */
  101.     XctFlags        flags;        /* as given to XctCreate */
  102.     int            version;    /* indicates the version of the CT spec
  103.                      * the string was produced from */
  104.     int            can_ignore_exts;/* non-zero if ignoring extensions is
  105.                      * acceptable, else zero */
  106.     XctString        item;        /* item returned from XctNextItem */
  107.     int            item_length;    /* length of item in bytes */
  108.     int            char_size;    /* number of bytes per character in
  109.                      * item, with zero meaning variable */
  110.     char        *encoding;    /* Encoding name for item */
  111.     XctHDirection    horizontal;    /* direction of item */
  112.     int            horz_depth;    /* current direction nesting depth */
  113.     char        *GL;        /* "{I} F" string for current GL */
  114.     char        *GL_encoding;    /* Encoding name for current GL */
  115.     int            GL_set_size;    /* 94 or 96 */
  116.     int            GL_char_size;    /* number of bytes per GL character */
  117.     char        *GR;        /* "{I} F" string for current GR */
  118.     char        *GR_encoding;    /* Encoding name for current GR */
  119.     int            GR_set_size;    /* 94 or 96 */
  120.     int            GR_char_size;    /* number of bytes per GR character */
  121.     char        *GLGR_encoding;    /* Encoding name for current GL+GR,
  122.                      * if known */
  123.     struct _XctPriv    *priv;        /* private to parser, don't peek */
  124. } *XctData;
  125.  
  126. /* these are the external routines */
  127. extern XctData XctCreate();
  128. extern XctResult XctNextItem();
  129. extern void XctFree();
  130. extern void XctReset();
  131.  
  132. #endif
  133.